home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / QD3DGroup.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-21  |  8.5 KB  |  279 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **                                                                             **
  4.  **     Module:        QD3DGroup.h                                                 **
  5.  **                                                                             **
  6.  **                                                                             **
  7.  **     Purpose:                                                             **
  8.  **                                                                             **
  9.  **                                                                             **
  10.  **     Copyright (C) 1992-1995 Apple Computer, Inc.  All rights reserved.     **
  11.  **                                                                             **
  12.  **                                                                             **
  13.  *****************************************************************************/
  14. #ifndef QD3DGroup_h
  15. #define QD3DGroup_h
  16.  
  17. #ifndef QD3D_h
  18. #include <QD3D.h>
  19. #endif  /*  QD3D_h  */
  20.  
  21. #if PRAGMA_ONCE
  22.     #pragma once
  23. #endif
  24.  
  25. #if defined(__MWERKS__)
  26.     #pragma enumsalwaysint on
  27.     #pragma align_array_members off
  28.     #pragma options align=native
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif /*  __cplusplus  */
  34.  
  35.  
  36. /******************************************************************************
  37.  **                                                                             **
  38.  **                            Group Typedefs                                     **
  39.  **                                                                             **
  40.  *****************************************************************************/
  41.  
  42. /*
  43.  * These flags affect how a group is traversed
  44.  * They apply to when a group is "drawn", "picked", "bounded", "written"
  45.  */
  46. typedef enum TQ3DisplayGroupStateMasks {
  47.     kQ3DisplayGroupStateNone                    = 0,
  48.     kQ3DisplayGroupStateMaskIsDrawn                = 1 << 0,
  49.     kQ3DisplayGroupStateMaskIsInline            = 1 << 1,
  50.     kQ3DisplayGroupStateMaskUseBoundingBox        = 1 << 2,
  51.     kQ3DisplayGroupStateMaskUseBoundingSphere    = 1 << 3,
  52.     kQ3DisplayGroupStateMaskIsPicked            = 1 << 4,
  53.     kQ3DisplayGroupStateMaskIsWritten            = 1 << 5
  54. } TQ3DisplayGroupStateMasks;
  55.  
  56. typedef unsigned long TQ3DisplayGroupState;
  57.  
  58. /******************************************************************************
  59.  **                                                                             **
  60.  **                    Group Routines (apply to all groups)                     **
  61.  **                                                                             **
  62.  *****************************************************************************/
  63.  
  64. QD3D_EXPORT TQ3GroupObject Q3Group_New(        /* May contain any shared object */
  65.     void);
  66.     
  67. QD3D_EXPORT TQ3ObjectType Q3Group_GetType(
  68.     TQ3GroupObject            group);
  69.  
  70. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObject(
  71.     TQ3GroupObject            group,
  72.     TQ3Object                object);
  73.     
  74. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObjectBefore(
  75.     TQ3GroupObject            group,
  76.     TQ3GroupPosition        position,
  77.     TQ3Object                object);
  78.  
  79. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObjectAfter(
  80.     TQ3GroupObject            group,
  81.     TQ3GroupPosition        position,
  82.     TQ3Object                object);
  83.  
  84. QD3D_EXPORT TQ3Status Q3Group_GetPositionObject(
  85.     TQ3GroupObject            group,
  86.     TQ3GroupPosition        position,    
  87.     TQ3Object                *object);        
  88.  
  89. QD3D_EXPORT TQ3Status Q3Group_SetPositionObject(
  90.     TQ3GroupObject            group,
  91.     TQ3GroupPosition        position,
  92.     TQ3Object                object);
  93.  
  94. QD3D_EXPORT TQ3Object Q3Group_RemovePosition(
  95.     TQ3GroupObject            group,
  96.     TQ3GroupPosition        position);
  97.  
  98. QD3D_EXPORT TQ3Status Q3Group_GetFirstPosition(        
  99.     TQ3GroupObject            group,
  100.     TQ3GroupPosition        *position);
  101.  
  102. QD3D_EXPORT TQ3Status Q3Group_GetLastPosition(        
  103.     TQ3GroupObject            group,
  104.     TQ3GroupPosition        *position);
  105.  
  106. QD3D_EXPORT TQ3Status Q3Group_GetNextPosition(        
  107.     TQ3GroupObject            group,
  108.     TQ3GroupPosition        *position);
  109.  
  110. QD3D_EXPORT TQ3Status Q3Group_GetPreviousPosition(        
  111.     TQ3GroupObject            group,
  112.     TQ3GroupPosition        *position);
  113.  
  114. QD3D_EXPORT TQ3Status Q3Group_CountObjects(
  115.     TQ3GroupObject            group,
  116.     unsigned long            *nObjects);
  117.  
  118. QD3D_EXPORT TQ3Status Q3Group_EmptyObjects(
  119.     TQ3GroupObject            group);
  120.     
  121. /*
  122.  *     Typed Access
  123.  */
  124. QD3D_EXPORT TQ3Status Q3Group_GetFirstPositionOfType(        
  125.     TQ3GroupObject            group,
  126.     TQ3ObjectType            isType,
  127.     TQ3GroupPosition        *position);
  128.  
  129. QD3D_EXPORT TQ3Status Q3Group_GetLastPositionOfType(        
  130.     TQ3GroupObject            group,
  131.     TQ3ObjectType            isType,
  132.     TQ3GroupPosition        *position);
  133.  
  134. QD3D_EXPORT TQ3Status Q3Group_GetNextPositionOfType(        
  135.     TQ3GroupObject            group,
  136.     TQ3ObjectType            isType,
  137.     TQ3GroupPosition        *position);
  138.  
  139. QD3D_EXPORT TQ3Status Q3Group_GetPreviousPositionOfType(        
  140.     TQ3GroupObject            group,
  141.     TQ3ObjectType            isType,
  142.     TQ3GroupPosition        *position);
  143.  
  144. QD3D_EXPORT TQ3Status Q3Group_CountObjectsOfType(
  145.     TQ3GroupObject            group,
  146.     TQ3ObjectType            isType,
  147.     unsigned long            *nObjects);
  148.  
  149. QD3D_EXPORT TQ3Status Q3Group_EmptyObjectsOfType(
  150.     TQ3GroupObject            group,
  151.     TQ3ObjectType            isType);
  152.  
  153. /*
  154.  *    Determine position of objects in a group
  155.  */
  156. QD3D_EXPORT TQ3Status Q3Group_GetFirstObjectPosition(
  157.     TQ3GroupObject            group,
  158.     TQ3Object                object,
  159.     TQ3GroupPosition        *position);
  160.     
  161. QD3D_EXPORT TQ3Status Q3Group_GetLastObjectPosition(
  162.     TQ3GroupObject            group,
  163.     TQ3Object                object,
  164.     TQ3GroupPosition        *position);
  165.  
  166. QD3D_EXPORT TQ3Status Q3Group_GetNextObjectPosition(
  167.     TQ3GroupObject            group,
  168.     TQ3Object                object,
  169.     TQ3GroupPosition        *position);
  170.     
  171. QD3D_EXPORT TQ3Status Q3Group_GetPreviousObjectPosition(
  172.     TQ3GroupObject            group,
  173.     TQ3Object                object,
  174.     TQ3GroupPosition        *position);
  175.     
  176.  
  177. /******************************************************************************
  178.  **                                                                             **
  179.  **                            Group Subclasses                                 **
  180.  **                                                                             **
  181.  *****************************************************************************/
  182.  
  183. QD3D_EXPORT TQ3GroupObject Q3LightGroup_New(        /* Must contain only lights */
  184.     void);
  185.  
  186. QD3D_EXPORT TQ3GroupObject Q3InfoGroup_New(            /* Must contain only strings */
  187.     void);
  188.  
  189. /******************************************************************************
  190.  **                                                                             **
  191.  **                        Display Group Routines                                 **
  192.  **                                                                             **
  193.  *****************************************************************************/
  194.  
  195. QD3D_EXPORT TQ3GroupObject Q3DisplayGroup_New(    /* May contain only drawables */
  196.     void);
  197.     
  198. QD3D_EXPORT TQ3ObjectType Q3DisplayGroup_GetType(
  199.     TQ3GroupObject            group);
  200.  
  201. QD3D_EXPORT TQ3Status Q3DisplayGroup_GetState(
  202.     TQ3GroupObject            group,
  203.     TQ3DisplayGroupState    *state);
  204.     
  205. QD3D_EXPORT TQ3Status Q3DisplayGroup_SetState(
  206.     TQ3GroupObject            group,
  207.     TQ3DisplayGroupState    state);
  208.  
  209. QD3D_EXPORT TQ3Status Q3DisplayGroup_Submit(
  210.     TQ3GroupObject            group, 
  211.     TQ3ViewObject            view);
  212.  
  213. /******************************************************************************
  214.  **                                                                             **
  215.  **        Ordered Display Group                                                  **
  216.  **                                                                             **
  217.  **        Ordered display groups keep objects in order by the type of object:     **
  218.  **                                                                             **
  219.  **        1    kQ3ShapeTypeTransform                                             **
  220.  **        2    kQ3ShapeTypeStyle                                                  **
  221.  **        3    kQ3SetTypeAttribute                                                  **
  222.  **        4    kQ3ShapeTypeShader                                                  **
  223.  **        5    kQ3ShapeTypeCamera                                                  **
  224.  **        6    kQ3ShapeTypeLight                                                  **
  225.  **        7    kQ3ShapeTypeGeometry                                             **
  226.  **        8    kQ3ShapeTypeGroup                                                 **            
  227.  **        9    kQ3ShapeTypeUnknown                                                 **
  228.  **                                                                             **
  229.  **        Within a type, you are responsible for keeping things in order.         **
  230.  **                                                                             **
  231.  **        You may access and/or manipulate the group using the above types      **
  232.  **        (fast), or you may use any parent or leaf class types (slower).         **
  233.  **                                                                             **
  234.  **        Additional types will be added as functionality grows.                 **
  235.  **                                                                             **
  236.  **        The group calls which access by type are much faster for ordered     ** 
  237.  **        display group for the types above.                                     **
  238.  **                                                                             **
  239.  **        N.B. In QuickDraw 3D 1.0 Lights and Cameras are a no-op when drawn.     **
  240.  **                                                                             **
  241.  *****************************************************************************/
  242.  
  243. QD3D_EXPORT TQ3GroupObject Q3OrderedDisplayGroup_New(
  244.     void);
  245.  
  246. /******************************************************************************
  247.  **                                                                             **
  248.  **        IO Proxy Display Group                                                  **
  249.  **                                                                             **
  250.  **        IO Proxy display groups are used to place more than one              **
  251.  **        representation of an object in a metafile. For example, if you know     **
  252.  **        another program does not understand NURBPatches but does understand  **
  253.  **        Meshes, you may place a mesh and a NURB Patch in an IO Proxy Group,  **
  254.  **        and the reading program will select the desired representation.         **
  255.  **                                                                             **
  256.  **        Objects in an IO Proxy Display Group are placed in their preferencial**
  257.  **        order, with the FIRST object being the MOST preferred, the LAST      **
  258.  **        object the least preferred.                                             **
  259.  **                                                                             **
  260.  **        The behavior of an IO Proxy Display Group is that when drawn/picked/ **
  261.  **        bounded, the first object in the group that is not "Unknown" is used,**
  262.  **        and the other objects ignored.                                         **
  263.  **                                                                             **
  264.  *****************************************************************************/
  265.  
  266. QD3D_EXPORT TQ3GroupObject Q3IOProxyDisplayGroup_New(
  267.     void);
  268.         
  269. #ifdef __cplusplus
  270. }
  271. #endif /*  __cplusplus  */
  272.  
  273. #if defined(__MWERKS__)
  274. #pragma options align=reset
  275. #pragma enumsalwaysint reset
  276. #endif
  277.  
  278. #endif /*  QD3DGroup_h  */
  279.